package gone;

import java.io.*;
import java.util.*;;

public class Shutdown extends Thread { 
	static int t;
	public Shutdown()
    {
    	t=0;
    }
	public Shutdown(int i)
    {
    	t=i;
    }
    public static void main(String[] args) throws Exception{ 
 
    	
        int minutes = Integer.valueOf(t); 
        Timer timer = new Timer(); 
        timer.schedule(new TimerTask() { 
        
            @Override 
            public void run() { 
                ProcessBuilder processBuilder = new ProcessBuilder("shutdown", 
                        "/s"); 
                try { 
                    processBuilder.start(); 
                } catch (IOException e) { 
                    throw new RuntimeException(e); 
                } 
            } 
 
        }, minutes * 60 * 1000); 
 
        System.out.println(" Shutting down in " + minutes + " minutes"); 
    } 
 } 

